var express = require('express')

var mongoose = require('mongoose')

mongoose.connect('mongodb://localhost/zy')

var db = mongoose.connection

db.on('error',(error)=>{
    console.log('数据库连接失败')
})
db.on('open',()=>{
    console.log('数据库连接成功')
})

exports.User = mongoose.model('user',{
    petname:String,
    password:String
})